<?

    include_once './functions.php';
    
    @import_request_variables('GPR','');
    
    // declarations
    $result = false;
    $chk = false;
    $messages = array();
    
    
    $result = imap_open("{news.free.fr:119/nntp}$group",'stanislas.perrin','f1sls-2');
    
    $chk = imap_check($result);
    
    // 10 derniers messages
    $lastMessageId = $chk->Recent;
    

    
    for ($i=0;$i<=10;$i++)
    {
        $messageId = $lastMessageId - $i;
        $messages[$messageId]['header'] = parseHeader(imap_fetchheader($result,$messageId));
        $messages[$messageId]['body'] = imap_body($result,$messageId);
    }
    
    ob_start();
        header("Cache-Control: no-store, no-cache, must-revalidate");
        header("Pragma: no-cache");
        header("Content-Type: text/xml");
        echo (rss091($messages));
    ob_end_flush();

?>